package com.nanjing.east.cloud.wechatpay;

import java.io.ByteArrayInputStream;
import java.io.InputStream;

public class MyConfig extends WXPayConfig {
	 private byte[] certData;

	    public MyConfig() throws Exception {
			InputStream certStream = MyConfig.class.getResourceAsStream("/cert/apiclient_cert.p12");
	        this.certData = new byte[1024];
	        certStream.read(this.certData);
	        certStream.close();
	    }

	    public String getAppID() {
	        return "wx51eb30e53f890ec0";
	    }

	    public String getMchID() {
	        return "1517545031";
	    }

	    public String getKey() {
	        return "dfcbg20181029dfcbg20181029dfcbg2";
	    }

	    public InputStream getCertStream() {
	        ByteArrayInputStream certBis = new ByteArrayInputStream(this.certData);
	        return certBis;
	    }

	    public int getHttpConnectTimeoutMs() {
	        return 8000;
	    }

	    public int getHttpReadTimeoutMs() {
	        return 10000;
	    }

		@Override
		IWXPayDomain getWXPayDomain() {
			//IWXPayDomain domain = new IWXPayDomain();
			return new MyWXpayDomain();
		}
}
